import { Observable } from './Observable';
export function filter(project: Function) {
  return (source: any) => {
    const observable = new Observable(function (subscriber) {
      return source.subscribe({
        ...subscriber,
        next: (value: any) => {
          project(value) && subscriber.next(value);
        }
      });
    });
    return observable;
  };
}
